package wordeditor.editors;

import java.util.Scanner;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;

class WordEditorConfiguration extends SourceViewerConfiguration {
	private ColorManager colorManager;

	public WordEditorConfiguration(ColorManager colorManager) {
		this.colorManager = colorManager;
		System.out.println("Configuration a");
	}
	
	
    public IPresentationReconciler getPresentationReconciler(
       //System.out.println("Configuration b" );	
       ISourceViewer sourceViewer) {
       PresentationReconciler pr = new PresentationReconciler();
       WordEditorScanner scan = new WordEditorScanner(colorManager) ;
       DefaultDamagerRepairer ddr = new DefaultDamagerRepairer(scan);
       pr.setRepairer(ddr, IDocument.DEFAULT_CONTENT_TYPE);
       pr.setDamager(ddr, IDocument.DEFAULT_CONTENT_TYPE);
       System.out.println("getPresentationReconciler");
       return pr;
    }
    

    
 }